package com.qf.android.huihui.adapter.shopping;

import android.content.Context;
import android.content.Intent;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.qf.android.huihui.R;
import com.qf.android.huihui.bean.ShoppingBean;
import com.qf.android.huihui.bean.show.shoppingbottom.CommonBean;
import com.qf.android.huihui.bean.show.shoppingbottom.Hot;
import com.qf.android.huihui.bean.show.shoppingbottom.HotBusiness;
import com.qf.android.huihui.bean.show.shoppingbottom.ShoppingBase;
import com.qf.android.huihui.bean.show.shoppingbottom.ShoppingBottomBean;
import com.qf.android.huihui.common.IClickListern;
import com.qf.android.huihui.common.MyRecyclerview;
import com.qf.android.huihui.view.activity.WebviewActivity;

import java.util.List;

/**
 * Created by 韩爽 on 2017/1/9.
 */

public class ShoppingAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements IClickListern, View.OnClickListener {
    private List<ShoppingBase> list;
    private Context context;
    private LayoutInflater inflater;
    private IClickListern listern=null;
    private static final int type_ShoppingBean = 1;
    private static final int type_HotsBean = 2;
    private static final int type_HuiZixunBean = 3;
    private static final int type_Dmail = 4;
    private static final int type_HotBuy = 5;
    private static final int type_HotSearch = 6;
    private static final int type_DetailList=7;
    private static final int type_BrandDay=8;
    private static final int type_Huodong=9;
    private static final int type_ShaiDan=10;
    private static final int type_EveryBuy=11;
    private static final int type_HuiItem=12;
    private static final int type_TopicGroup=13;
    private String TAG="THIS";

    public ShoppingAdapter(List<ShoppingBase> list, Context context) {
        this.list = list;
        this.context = context;
        inflater = LayoutInflater.from(context);
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        if (viewType == type_ShoppingBean) {
            View view = inflater.inflate(R.layout.fragment_recyclerview_head, parent, false);
            MyViewHolder myViewHolder = new MyViewHolder(view);
            return myViewHolder;
        } else if (viewType == type_HotsBean) {
            View view = inflater.inflate(R.layout.fragment_recyclerview_bottom_hot_recommend_item, parent, false);
            HotRecommend_Holder hotRecommend_holder = new HotRecommend_Holder(view);
            return hotRecommend_holder;
        } else if (viewType == type_Dmail) {
            View view = inflater.inflate(R.layout.fragment_shopping_dmail, parent, false);
            Dmail_Holder dmail_holder = new Dmail_Holder(view);
            return dmail_holder;
        } else if (viewType == type_HotBuy) {
            View view = inflater.inflate(R.layout.fragment_shopping_hot, parent, false);
            HotBuy_Holder hotBuy_holder = new HotBuy_Holder(view);
            return hotBuy_holder;
        } else if (viewType == type_HotSearch) {
            View view = inflater.inflate(R.layout.fragment_shopping_hotsearch, parent, false);
            HotSearch_Holder hotSearch_holder = new HotSearch_Holder(view);
            return hotSearch_holder;
        }else if(viewType == type_DetailList){
            View view=inflater.inflate(R.layout.fragment_shopping_detail_list,parent,false);
            DetailList_Holder detailList_holder=new DetailList_Holder(view);
            return detailList_holder;
        }else if(viewType == type_Huodong || viewType ==type_BrandDay || viewType==type_ShaiDan ||viewType==type_HuiZixunBean){
            View view = inflater.inflate(R.layout.fragment_shopping_zixun, parent, false);
            view.setOnClickListener(this);
            HuiZixun_Holder huiZixun_holder = new HuiZixun_Holder(view);
            return huiZixun_holder;
        }else if(viewType == type_EveryBuy){
            View view=inflater.inflate(R.layout.fragment_shopping_everybuy,parent,false);
            EveryBuy_Holder everyBuy_holder=new EveryBuy_Holder(view);
            return everyBuy_holder;
        } else if (viewType == type_HuiItem){
            View view = inflater.inflate(R.layout.fragment_shopping_huiitem, parent, false);
            HuiItem_Holder huiItem_holder=new HuiItem_Holder(view);
            return huiItem_holder;
        }else if (viewType == type_TopicGroup){
            View view = inflater.inflate(R.layout.fragment_shopping_topicgroup, parent, false);
            TopicGroup_Holder topicGroup_holder=new TopicGroup_Holder(view);
            return topicGroup_holder;
        }else{
            View view=inflater.inflate(R.layout.fragment_shopping_zhanwei,parent,false);
            ZhanWei zhanWei=new ZhanWei(view);
            return zhanWei;
        }

    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        int type = getItemViewType(position);
        //热门推荐
        if (type == type_ShoppingBean) {
            ShoppingBean shoppingBean = (ShoppingBean) list.get(position);
            List<ShoppingBean.DataBean.TopBean> top = shoppingBean.getData().getTop();
            List<ShoppingBean.DataBean.BottomBean> bottom = shoppingBean.getData().getBottom();
            //top
            ShoppoingTopAdapter topAdapter = new ShoppoingTopAdapter(top, context);
            topAdapter.setMyClickListener(this);
            ((MyViewHolder) holder).viewPager_top.setAdapter(topAdapter);
            //bottom
            ShoppingBottomAdapter bottomAdapter = new ShoppingBottomAdapter(bottom, context);
            bottomAdapter.setMyClickListener(this);
            LinearLayoutManager manager = new LinearLayoutManager(context);
            manager.setOrientation(LinearLayoutManager.HORIZONTAL);
            ((MyViewHolder) holder).recycler_bottom.setLayoutManager(manager);
            ((MyViewHolder) holder).recycler_bottom.setAdapter(bottomAdapter);
        } else if (type == type_HotsBean) {
            final HotBusiness.DataBean.HotsBean hotsBean = (HotBusiness.DataBean.HotsBean) list.get(position);
            HotRecommend_Holder hotRecommend_holder = (HotRecommend_Holder) holder;
            Glide.with(context).load(hotsBean.getLogo()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(hotRecommend_holder.include_title_imageview);
            hotRecommend_holder.include_tilte_textview.setText(hotsBean.getDesc());
            Glide.with(context).load(hotsBean.getLeft().getImageUrl()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(hotRecommend_holder.include_imageview);
            GridLayoutManager manager = new GridLayoutManager(context, 3);
            hotRecommend_holder.include_recyclerView.setLayoutManager(manager);
            ShoppingHotRecAdapter adapter = new ShoppingHotRecAdapter(hotsBean.getList(), context);
            //热门推荐的监听
            hotRecommend_holder.include_imageview.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent = new Intent(context, WebviewActivity.class);
                    intent.putExtra("url",hotsBean.getLeft().getUrl().toString());
                    context.startActivity(intent);
                }
            });
            adapter.setMyClickListener(this);
            hotRecommend_holder.include_recyclerView.setAdapter(adapter);


        } else if (type == type_HuiZixunBean) {
            ShoppingBottomBean.DataBean.ListBeanXX.HuiZixunBean huiZixunBean = (ShoppingBottomBean.DataBean.ListBeanXX.HuiZixunBean) list.get(position);
            HuiZixun_Holder huiZixun_holder = (HuiZixun_Holder) holder;
            huiZixun_holder.textView_title.setText(huiZixunBean.getGroupName());
            Glide.with(context).load(huiZixunBean.getGroupImage()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(huiZixun_holder.imageview_title);
            huiZixun_holder.textView_content_title.setText(huiZixunBean.getTitle());
            Glide.with(context).load(huiZixunBean.getImageUrl()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(huiZixun_holder.imageview_content);
            huiZixun_holder.textView_content_content.setText(huiZixunBean.getSubTitle());
            holder.itemView.setTag(huiZixunBean.getUrl());
        } else if (type == type_Dmail) {
            /**
             * 直邮商家
             */
            HotBusiness.DataBean.DmailBean dmailBean = (HotBusiness.DataBean.DmailBean) list.get(position);
            Dmail_Holder dmail_holder = (Dmail_Holder) holder;
            Glide.with(context).load(dmailBean.getLogo()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(dmail_holder.include_image);
            dmail_holder.include_textview.setText(dmailBean.getDesc());
            GridLayoutManager manager = new GridLayoutManager(context, 4);
            dmail_holder.recyclerView.setLayoutManager(manager);
            ShoppingDmailAdapter adapter = new ShoppingDmailAdapter(dmailBean.getList(), context);
            adapter.setMyClickListener(this);
            dmail_holder.recyclerView.setAdapter(adapter);
        } else if (type == type_HotBuy) {
            Hot hot = (Hot) list.get(position);
            HotBuy_Holder hotBuy_holder = (HotBuy_Holder) holder;
            hotBuy_holder.include_textview.setText(hot.getData().getTitle());
            Glide.with(context).load(hot.getData().getGroupImage()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(hotBuy_holder.include_image);
            LinearLayoutManager manager = new LinearLayoutManager(context);
            manager.setOrientation(LinearLayoutManager.HORIZONTAL);
            hotBuy_holder.recyclerView.setLayoutManager(manager);
            ShoppingHotAdapter adapter = new ShoppingHotAdapter(hot.getData().getList(), context);
            adapter.setMyClickListener(this);
            hotBuy_holder.recyclerView.setAdapter(adapter);
        } else if (type == type_HotSearch) {
            ShoppingBottomBean.DataBean.ListBeanXX.HotSearchBean hotSearchBean = (ShoppingBottomBean.DataBean.ListBeanXX.HotSearchBean) list.get(position);
            HotSearch_Holder hotSearch_holder = (HotSearch_Holder) holder;
            hotSearch_holder.title.setText("热门搜索");
            GridLayoutManager manager=new GridLayoutManager(context,4);
            hotSearch_holder.recyclerView.setLayoutManager(manager);
            ShoppingHotSearchAdapter adapter=new ShoppingHotSearchAdapter(hotSearchBean.getList(),context);
            hotSearch_holder.recyclerView.setAdapter(adapter);
        }else if(type == type_DetailList){
            ShoppingBottomBean.DataBean.ListBeanXX.QingDanBean qingDanBean = (ShoppingBottomBean.DataBean.ListBeanXX.QingDanBean) list.get(position);
            DetailList_Holder detailList_holder = (DetailList_Holder) holder;
            detailList_holder.textView.setText(qingDanBean.getGroupName());
            Glide.with(context).load(qingDanBean.getGroupImage()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(detailList_holder.imageView);
            Glide.with(context).load(qingDanBean.getImageUrl()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(detailList_holder.detail_iv);
            Glide.with(context).load(qingDanBean.getItems().get(0)).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(detailList_holder.detail_1);
            Glide.with(context).load(qingDanBean.getItems().get(1)).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(detailList_holder.detail_2);
            Glide.with(context).load(qingDanBean.getItems().get(2)).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(detailList_holder.detail_3);
            Glide.with(context).load(qingDanBean.getItems().get(3)).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(detailList_holder.detail_4);
            Glide.with(context).load(qingDanBean.getItems().get(4)).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(detailList_holder.detail_5);
        }else  if(type == type_Huodong){
            ShoppingBottomBean.DataBean.ListBeanXX.HuiHuodongBean huiHuodongBean = (ShoppingBottomBean.DataBean.ListBeanXX.HuiHuodongBean) list.get(position);

            HuiZixun_Holder huiZixun_holder = (HuiZixun_Holder) holder;
            huiZixun_holder.textView_title.setText(huiHuodongBean.getGroupName());
            Glide.with(context).load(huiHuodongBean.getGroupImage()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(huiZixun_holder.imageview_title);
            huiZixun_holder.textView_content_title.setText(huiHuodongBean.getTitle());
            Glide.with(context).load(huiHuodongBean.getImageUrl()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(huiZixun_holder.imageview_content);
            huiZixun_holder.textView_content_content.setText(huiHuodongBean.getSummary());
            holder.itemView.setTag(huiHuodongBean.getUrl());
        }else if(type == type_BrandDay){
            ShoppingBottomBean.DataBean.ListBeanXX.BrandDayBean brandDayBean = (ShoppingBottomBean.DataBean.ListBeanXX.BrandDayBean) list.get(position);
            HuiZixun_Holder huiZixun_holder = (HuiZixun_Holder) holder;
            huiZixun_holder.textView_title.setText(brandDayBean.getGroupName());
            Glide.with(context).load(brandDayBean.getGroupImage()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(huiZixun_holder.imageview_title);
            huiZixun_holder.textView_content_title.setText(brandDayBean.getTitle());
            Glide.with(context).load(brandDayBean.getImageUrl()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(huiZixun_holder.imageview_content);
            huiZixun_holder.textView_content_content.setText(brandDayBean.getSubTitle());
            holder.itemView.setTag(brandDayBean.getUrl());
        }else if(type == type_ShaiDan){
            ShoppingBottomBean.DataBean.ListBeanXX.ShaiDanBean shaiDanBean = (ShoppingBottomBean.DataBean.ListBeanXX.ShaiDanBean) list.get(position);
            HuiZixun_Holder huiZixun_holder = (HuiZixun_Holder) holder;
            huiZixun_holder.textView_title.setText(shaiDanBean.getGroupName());
            Glide.with(context).load(shaiDanBean.getGroupImage()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(huiZixun_holder.imageview_title);
            huiZixun_holder.textView_content_title.setText(shaiDanBean.getTitle());
            Glide.with(context).load(shaiDanBean.getImageUrl()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(huiZixun_holder.imageview_content);
            huiZixun_holder.textView_content_content.setText(shaiDanBean.getSubTitle());

        }else if(type == type_EveryBuy){
            CommonBean.HaitaoItemClass haitaoItemClass = (CommonBean.HaitaoItemClass) list.get(position);
            EveryBuy_Holder everyBuy_holder = (EveryBuy_Holder) holder;
            if(haitaoItemClass.getList().size()!=0) {
                everyBuy_holder.textView.setText(haitaoItemClass.getList().get(0).getGroupName());
                Glide.with(context).load(haitaoItemClass.getList().get(0).getGroupImage()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(everyBuy_holder.imageView);
                GridLayoutManager manager = new GridLayoutManager(context, 2);
                everyBuy_holder.recyclerView.setLayoutManager(manager);
                ShoppingEveryBuyAdapter adapter = new ShoppingEveryBuyAdapter(haitaoItemClass.getList(), context);
                adapter.setMyClickListener(this);
                everyBuy_holder.recyclerView.setAdapter(adapter);


            }
        }else  if(type == type_HuiItem){
            CommonBean.HuiItemClass huiItemClass = (CommonBean.HuiItemClass) list.get(position);
            HuiItem_Holder huiItem_holder = (HuiItem_Holder) holder;
            if(huiItemClass.getList().size()!=0) {
                huiItem_holder.title_textview.setText(huiItemClass.getList().get(0).getGroupName());
                Glide.with(context).load(huiItemClass.getList().get(0).getGroupImage()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(huiItem_holder.title_imageview);
                LinearLayoutManager manager = new LinearLayoutManager(context);
                huiItem_holder.recyclerView.setLayoutManager(manager);
                ShoppingHuiItemAdapter adapter = new ShoppingHuiItemAdapter(huiItemClass.getList(), context);
                adapter.setMyClickListener(this);
                huiItem_holder.recyclerView.setAdapter(adapter);
            }
        }else if(type==type_TopicGroup){
            ShoppingBottomBean.DataBean.ListBeanXX.TopicGroupBean topicGroupBean = (ShoppingBottomBean.DataBean.ListBeanXX.TopicGroupBean) list.get(position);
            TopicGroup_Holder topicGroup_holder = (TopicGroup_Holder) holder;
                topicGroup_holder.include_textview.setText(topicGroupBean.getGroupName());
                Glide.with(context).load(topicGroupBean.getGroupImage()).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.ALL).into(topicGroup_holder.include_image);
                topicGroup_holder.textView.setText(topicGroupBean.getTitle());
                LinearLayoutManager manager=new LinearLayoutManager(context);
                manager.setOrientation(LinearLayoutManager.HORIZONTAL);
                topicGroup_holder.recyclerView.setLayoutManager(manager);
                ShoppingTopicGroupAdapter adapter=new ShoppingTopicGroupAdapter(topicGroupBean.getList(),context);
                topicGroup_holder.recyclerView.setAdapter(adapter);

        }
    }

    @Override
    public int getItemViewType(int position) {
        ShoppingBase base = list.get(position);
        if (base instanceof ShoppingBean) {
            return type_ShoppingBean;
        } else if (base instanceof HotBusiness.DataBean.HotsBean) {
            return type_HotsBean;
        } else if (base instanceof ShoppingBottomBean.DataBean.ListBeanXX.HuiZixunBean) {
            return type_HuiZixunBean;
        } else if (base instanceof HotBusiness.DataBean.DmailBean) {
            return type_Dmail;
        } else if (base instanceof Hot) {
            return type_HotBuy;
        } else if (base instanceof ShoppingBottomBean.DataBean.ListBeanXX.HotSearchBean) {
            return type_HotSearch;
        }else if (base instanceof ShoppingBottomBean.DataBean.ListBeanXX.QingDanBean){
            return type_DetailList;
        }else if(base instanceof ShoppingBottomBean.DataBean.ListBeanXX.BrandDayBean){
            return type_BrandDay;
        }else if(base instanceof ShoppingBottomBean.DataBean.ListBeanXX.HuiHuodongBean){
            return type_Huodong;
        }else if(base instanceof ShoppingBottomBean.DataBean.ListBeanXX.ShaiDanBean){
            return type_ShaiDan;
        }else if (base instanceof CommonBean.HaitaoItemClass){
            return type_EveryBuy;
        }else if(base instanceof CommonBean.HuiItemClass){
            return  type_HuiItem;
        }else if(base instanceof ShoppingBottomBean.DataBean.ListBeanXX.TopicGroupBean){
            return type_TopicGroup;
        } else {
            return 0;
        }
    }

    @Override
    public int getItemCount() {
        return list.size();
    }

    @Override
    public void OnItemClick(View view, String url) {
        Intent intent = new Intent(context, WebviewActivity.class);
        intent.putExtra("url", url);
        context.startActivity(intent);
    }

    @Override
    public void onClick(View v) {
        if(listern!=null){
            listern.OnItemClick(v,(String)v.getTag());
        }
    }
    public void setMyClickListener(IClickListern listener) {
        this.listern = listener;
    }

    class MyViewHolder extends RecyclerView.ViewHolder {
        private ViewPager viewPager_top;
        private MyRecyclerview recycler_bottom;
        private LinearLayout linearLayout;

        public MyViewHolder(View itemView) {
            super(itemView);
            viewPager_top = (ViewPager) itemView.findViewById(R.id.recyclerview_head_top);
            recycler_bottom = (MyRecyclerview) itemView.findViewById(R.id.recyclerview_head_bottom);
            linearLayout = (LinearLayout) itemView.findViewById(R.id.recyclerview_head_middle);
        }

    }
    class HotRecommend_Holder extends RecyclerView.ViewHolder {
        private ImageView include_title_imageview;
        private TextView include_tilte_textview;
        private ImageView include_imageview;
        private RecyclerView include_recyclerView;

        public HotRecommend_Holder(View itemView) {
            super(itemView);
            include_title_imageview = (ImageView) itemView.findViewById(R.id.hto_recommend_include).findViewById(R.id.include_imageView);
            include_tilte_textview = (TextView) itemView.findViewById(R.id.hto_recommend_include).findViewById(R.id.include_title);
            include_imageview = (ImageView) itemView.findViewById(R.id.hot_recommend_imageview);
            include_recyclerView = (RecyclerView) itemView.findViewById(R.id.hot_recommend_recyclerview);
        }
    }
    class HuiZixun_Holder extends RecyclerView.ViewHolder {
        private TextView textView_title;
        private ImageView imageview_title;
        private ImageView imageview_content;
        private TextView textView_content_title;
        private TextView textView_content_content;

        public HuiZixun_Holder(View itemView) {
            super(itemView);
            textView_title = (TextView) itemView.findViewById(R.id.fragment_shopping_zixun_title_include).findViewById(R.id.include_title);
            imageview_title = (ImageView) itemView.findViewById(R.id.fragment_shopping_zixun_title_include).findViewById(R.id.include_imageView);
            imageview_content = (ImageView) itemView.findViewById(R.id.zixun_image);
            textView_content_title = (TextView) itemView.findViewById(R.id.zixun_text_title);
            textView_content_content = (TextView) itemView.findViewById(R.id.zixun_text_content);
        }
    }
    class Dmail_Holder extends RecyclerView.ViewHolder {
        private ImageView include_image;
        private TextView include_textview;
        private RecyclerView recyclerView;

        public Dmail_Holder(View itemView) {
            super(itemView);
            include_image = (ImageView) itemView.findViewById(R.id.fragment_shopping_dmail_include).findViewById(R.id.include_imageView);
            include_textview = (TextView) itemView.findViewById(R.id.fragment_shopping_dmail_include).findViewById(R.id.include_title);
            recyclerView = (RecyclerView) itemView.findViewById(R.id.fragment_shopping_dmail_recycler);
        }
    }
    class HotBuy_Holder extends RecyclerView.ViewHolder {
        private ImageView include_image;
        private TextView include_textview;
        private RecyclerView recyclerView;

        public HotBuy_Holder(View itemView) {
            super(itemView);
            include_image = (ImageView) itemView.findViewById(R.id.fragment_shopping_hot_include).findViewById(R.id.include_imageView);
            include_textview = (TextView) itemView.findViewById(R.id.fragment_shopping_hot_include).findViewById(R.id.include_title);
            recyclerView = (RecyclerView) itemView.findViewById(R.id.fragment_shopping_hot_recycler);
        }
    }
    class HotSearch_Holder extends RecyclerView.ViewHolder {
        private TextView title;
        private RecyclerView recyclerView;

        public HotSearch_Holder(View itemView) {
            super(itemView);
            title = (TextView) itemView.findViewById(R.id.hotsearch_title);
            recyclerView = (RecyclerView) itemView.findViewById(R.id.hotsearch_recyclerview);
        }
    }
    class DetailList_Holder extends RecyclerView.ViewHolder{
        private ImageView imageView;
        private TextView textView;
        private ImageView detail_iv;
        private ImageView detail_1;
        private ImageView detail_2;
        private ImageView detail_3;
        private ImageView detail_4;
        private ImageView detail_5;
        public DetailList_Holder(View itemView) {
            super(itemView);
            textView= (TextView) itemView.findViewById(R.id.fragment_shopping_detail_list_include).findViewById(R.id.include_title);
            imageView= (ImageView) itemView.findViewById(R.id.fragment_shopping_detail_list_include).findViewById(R.id.include_imageView);
            detail_iv= (ImageView) itemView.findViewById(R.id.detail_iv);
            detail_1= (ImageView) itemView.findViewById(R.id.iv_1);
            detail_2= (ImageView) itemView.findViewById(R.id.iv_2);
            detail_3= (ImageView) itemView.findViewById(R.id.iv_3);
            detail_4= (ImageView) itemView.findViewById(R.id.iv_4);
            detail_5= (ImageView) itemView.findViewById(R.id.iv_5);
        }
    }
    class EveryBuy_Holder  extends RecyclerView.ViewHolder{
        private ImageView imageView;
        private TextView textView;
        private RecyclerView recyclerView;
        public EveryBuy_Holder(View itemView) {
            super(itemView);
            imageView= (ImageView) itemView.findViewById(R.id.everybody_item_include_title).findViewById(R.id.include_imageView);
            textView= (TextView) itemView.findViewById(R.id.everybody_item_include_title).findViewById(R.id.include_title);
            recyclerView= (RecyclerView) itemView.findViewById(R.id.everybody_item_recyclerview);
        }
    }
    class HuiItem_Holder extends RecyclerView.ViewHolder{
        private ImageView title_imageview;
        private TextView title_textview;
        private RecyclerView recyclerView;
        public HuiItem_Holder(View itemView) {
            super(itemView);
            title_imageview= (ImageView) itemView.findViewById(R.id.huiitem_include).findViewById(R.id.include_imageView);
            title_textview= (TextView) itemView.findViewById(R.id.huiitem_include).findViewById(R.id.include_title);
            recyclerView= (RecyclerView) itemView.findViewById(R.id.huiitem_recyclerview);
        }
    }
    class TopicGroup_Holder extends RecyclerView.ViewHolder{
        private ImageView include_image;
        private TextView include_textview;
        private TextView textView;
        private RecyclerView recyclerView;
        public TopicGroup_Holder(View itemView) {
            super(itemView);
            include_image= (ImageView) itemView.findViewById(R.id.topicgroup_include).findViewById(R.id.include_imageView);
            include_textview= (TextView) itemView.findViewById(R.id.topicgroup_include).findViewById(R.id.include_title);
            textView= (TextView) itemView.findViewById(R.id.topicgroup_textview);
            recyclerView= (RecyclerView) itemView.findViewById(R.id.topicgroup_recyclerview);
        }
    }
    class ZhanWei extends RecyclerView.ViewHolder {
        public ZhanWei(View itemView) {
            super(itemView);
        }
    }
}